
package hexxagon;

import jgame.JGObject;
import jgame.JGPoint;

public class Figure extends JGObject {
    static JGPoint IndexToPos = new JGPoint();
    static JGPoint PosToIndex = new JGPoint();
    private static final int GOC_X = 20;
    private static final int GOC_Y = 134;
    public Figure(int i, int j, int figure){
        super("figure", true, 0, 0, 0, "figure" + figure);
        translateIndexToPos(i, j);
        setPos(IndexToPos.x, IndexToPos.y);
    }

    public Figure(int x, int y){
        super("cursor", true, x, y, 0, "cursor");
        translateIndexToPos(x, y);
        setPos(IndexToPos.x, IndexToPos.y);
    }
    public static void translateIndexToPos(int x, int y) {
        IndexToPos.x = (int) (GOC_X + x * 81.75f);
        IndexToPos.y = (int) (GOC_Y + y * 65 - x * 32.5f);
    }
}
